﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace RolePlaying.Events
{
    public class ActiveRectangle
    {
        public ActiveRectangle()
        {
        }

        public delegate void mouseStateDelegate(MouseState state, ActiveRectangle ar);

        public Rectangle rect { get; set; }
        public string Name { get; set; }
        public string Screen { get; set; }


        public event mouseStateDelegate OnMouseMove;
        public event mouseStateDelegate OnMouseLeft;
        public event mouseStateDelegate OnMouseRight;

        public void Fire_OnMouseMove(MouseState state, ActiveRectangle ar)
        {
            if (OnMouseMove != null)
            {
                OnMouseMove(state, this);
            }
        }

        public void Fire_OnMouseRight(MouseState state)
        {
            if (OnMouseRight != null)
            {
                OnMouseRight(state, this);
            }
        }

        public void Fire_OnMouseLeft(MouseState state)
        {
            if (OnMouseLeft != null)
            {
                OnMouseLeft(state, this);
            }
        }

        public Vector2 GetVector()
        {
            return new Vector2(rect.X, rect.Y);
        }
    }
}
